package com.corona.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.utils.ScreenUtils;
import com.corona.Game;
import com.corona.game.util.TextureCache;

/* compiled from: PkmnMap.java */
/* loaded from: pokewilds.jar:com/pkmngen/game/EscapeRope.class */
public class EscapeRope extends Action {
    Sprite sprite;
    Sprite sprite2;
    public Action.Layer layer = Action.Layer.gui_114;
    int timer = 0;
    int slow = 3;

    public EscapeRope(Action nextAction) {
        super(new Object[0]);
        this.nextAction = nextAction;
        Texture text1 = TextureCache.get(Gdx.files.internal("battle/intro_frame6.png"));
        this.sprite = new Sprite(text1);
        this.sprite.setPosition(0.0f, 0.0f);
        this.sprite2 = new Sprite(text1);
        this.sprite.setPosition(-144.0f, 0.0f);
    }

    @Override // com.corona.game.Action
    public String getCamera() {
        return "gui";
    }

    @Override // com.corona.game.Action
    public Action.Layer getLayer() {
        return this.layer;
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (this.timer < 2 * this.slow) {
            if (this.timer == 0) {
                game.insertAction(new PlayMusic("enter1", (Action) null));
            }
        } else if (this.timer < 4 * this.slow) {
            this.sprite.draw(game.uiBatch, 0.25f);
            this.sprite2.draw(game.uiBatch, 0.25f);
        } else if (this.timer < 6 * this.slow) {
            this.sprite.draw(game.uiBatch, 0.5f);
            this.sprite2.draw(game.uiBatch, 0.5f);
        } else if (this.timer < 22 * this.slow) {
            if (this.timer == 6 * this.slow) {
                game.map.interiorTilesIndex = 100;
                game.map.tiles = game.map.overworldTiles;
                game.player.dirFacing = "down";
                game.player.currSprite = game.player.standingSprites.get(game.player.dirFacing);
                ScreenUtils.clear(0.0f, 0.0f, 0.0f, 1.0f, true);
                if (!game.map.timeOfDay.equals("night")) {
                    game.mapBatch.setColor(new Color(1.0f, 1.0f, 1.0f, 1.0f));
                } else {
                    game.mapBatch.setColor(new Color(PkmnMap.nightColor));
                }
            }
            this.sprite.draw(game.uiBatch, 1.0f);
            this.sprite2.draw(game.uiBatch, 1.0f);
        } else if (this.timer < 24 * this.slow) {
            if (this.timer == 22 * this.slow) {
                game.insertAction(new PlayMusic("exit1", (Action) null));
            }
            this.sprite.draw(game.uiBatch, 0.75f);
            this.sprite2.draw(game.uiBatch, 0.75f);
        } else if (this.timer < 26 * this.slow) {
            this.sprite.draw(game.uiBatch, 0.5f);
            this.sprite2.draw(game.uiBatch, 0.5f);
        } else if (this.timer < 28 * this.slow) {
            this.sprite.draw(game.uiBatch, 0.25f);
            this.sprite2.draw(game.uiBatch, 0.25f);
        } else {
            game.actionStack.remove(this);
            game.insertAction(this.nextAction);
        }
        this.timer++;
    }
}
